package com.greenant.store.bean;

import java.util.ArrayList;
import java.util.List;

import com.avos.avoscloud.AVACL;
import com.avos.avoscloud.AVClassName;
import com.avos.avoscloud.AVRelation;

@AVClassName(AntAVObject.CLASS_GOODS_KIND)
public class GoodsKind extends AntAVObject {
	
	public static final String ATTR_NAME ="name";
	public static final String ATTR_USERSTYLE ="userStyle";
	public static final String ATTR_SHOWINDEX ="showIndex";
	public static final String ATTR_STYLELIST ="styleList";
	public static final String ATTR_USERID ="userId";
	
	private List<AntGoodsStyles> goodsStylesList;
	
	public GoodsKind() {
		super(AntAVObject.CLASS_GOODS_KIND);
		setAccessCtrl();
	}
	
	public AVRelation<AntGoodsStyles> getStyleRelation() {
		return this.getRelation(ATTR_STYLELIST);
	}
	
	public String getUserId()
	{
		return this.getString(ATTR_USERID);
	}
	
	public void setUserId(String userId)
	{		
		this.put(ATTR_USERID, userId);
	}
	
	public String getName()
	{
		return this.getString(ATTR_NAME);
	}
	
	public void setName(String name)
	{
		this.put(ATTR_NAME, name);
	}
	
	public String getUserStyle()
	{
		return this.getString(ATTR_USERSTYLE);
	}
	 
	public void setUserStyle(int count)
	{
		this.put(ATTR_USERSTYLE,count);
	}
	
	public int getShowIndex()
	{
		return this.getInt(ATTR_SHOWINDEX);
	}
	
	public void setShowIndex(int count)
	{
		this.put(ATTR_SHOWINDEX,count);
	}
	
	public List<AntGoodsStyles> getGoodsStylesList()
	{
		if(goodsStylesList == null)
		{
			goodsStylesList = new ArrayList<AntGoodsStyles>(); 
		}
		return goodsStylesList;
	}

	public void setGoodsStylesList(List<AntGoodsStyles> goodsStylesList)
	{
		this.goodsStylesList = goodsStylesList;
	}
	
	private int setAccessCtrl() {

		acl = new AVACL();
		acl.setPublicReadAccess(true);// �˴����õ��������˵Ŀɶ�Ȩ��
		acl.setPublicWriteAccess(true);

		return 0;
	}
}
